package com.slz3.business.module.drawManagement.draFreeLottery.steward;

import com.slz3.business.module.drawManagement.draFreeLottery.domain.DraFreeLottery;
import com.slz3.business.module.drawManagement.draFreeLottery.domain.DraFreeLotteryCondition;
import com.slz3.business.module.drawManagement.draIntegralLottery.domain.DraIntegralLotteryCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class DraFreeLotteryResponse {

    @Resource
    private DraFreeLotteryResController draFreeLotteryResController;

    public  Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(DraFreeLottery.class).flatMap(draFreeLottery ->
                draFreeLotteryResController.add(req, draFreeLottery)
        );
    }

    public  Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(DraFreeLotteryCondition.class).flatMap(draFreeLotteryCondition ->
                draFreeLotteryResController.delete(req, draFreeLotteryCondition)
        );
    }

    public  Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(DraFreeLottery.class).flatMap(draFreeLottery ->
                draFreeLotteryResController.modify(req, draFreeLottery)
        );
    }


    public  Mono<ServerResponse> list(ServerRequest req) {
        return draFreeLotteryResController.list(req);
    }

    public  Mono<ServerResponse> info(ServerRequest req) {
        return draFreeLotteryResController.info(req);
    }

    public  Mono<ServerResponse> choice(ServerRequest req) {
        return draFreeLotteryResController.choice(req);
    }

    public  Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(DraFreeLotteryCondition.class).flatMap(draFreeLotteryCondition ->
                draFreeLotteryResController.auditSubmit(req, draFreeLotteryCondition)
        );
    }

    public  Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(DraFreeLotteryCondition.class).flatMap(draFreeLotteryCondition ->
                draFreeLotteryResController.audit(req, draFreeLotteryCondition)
        );
    }

    public  Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(DraFreeLotteryCondition.class).flatMap(draFreeLotteryCondition ->
                draFreeLotteryResController.auditReject(req, draFreeLotteryCondition)
        );
    }

    public  Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(DraFreeLotteryCondition.class).flatMap(draFreeLotteryCondition ->
                draFreeLotteryResController.usingEnable(req, draFreeLotteryCondition)
        );
    }

    public  Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(DraFreeLotteryCondition.class).flatMap(draFreeLotteryCondition ->
                draFreeLotteryResController.usingDisable(req, draFreeLotteryCondition)
        );
    }
    public Mono<ServerResponse> lottery(ServerRequest req) {
        return req.bodyToMono(DraFreeLotteryCondition.class).flatMap(draFreeLotteryCondition ->
                draFreeLotteryResController.lottery(req, draFreeLotteryCondition)
        );
    }
}
